﻿using SAPbobsCOM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompanySyncProject
{
    public class DIJournalEntry: BaseRun
    {
        public DIJournalEntry(Company co, System.IO.StreamWriter lo)
            : base(co, lo)
        {

        }

        public override void Run()
        {
            oCompany.XmlExportType = BoXmlExportTypes.xet_ExportImportMode;
            oCompany.XMLAsString = true;

            SAPbobsCOM.JournalEntries je = oCompany.GetBusinessObject(BoObjectTypes.oJournalEntries);
            je.Reference = "ref123";
            je.Lines.AccountCode = "100101";
            je.Lines.Debit = 100;
            je.Lines.Add();
            je.Lines.AccountCode = "100102";
            je.Lines.Credit = 100;
            je.Lines.Add();
            je.SaveXML(@"D:\code\testing\DITest\CompanySyncProject\test\exportje.txt");


            string errMsg = oCompany.GetLastErrorDescription();
        }
    }
}
